Skip to content

Conversation

@bitsandfoxes
Copy link
Contributor

@bitsandfoxes bitsandfoxes commented Jan 15, 2026

Closes #2004

Problem Statement

The existing time-based log debouncing system throttles events purely based on time intervals per log type. This approach has limitations:

  • Identical errors occurring in rapid succession consume quota unnecessarily
  • Different errors of the same log type get incorrectly throttled together
  • No distinction between repeated errors and unique errors happening close together

Proposal

Replace time-based debouncing with content-based event throttling that deduplicates based on the actual error content (message + stacktrace fingerprint). This ensures:

  • Repeated identical errors are deduplicated within a time window
  • Unique errors are always captured, regardless of timing
  • Quota is preserved without losing distinct error information

Implementation

The new throttling system has the following elements

  • IErrorEventThrottler interface - Abstraction allowing custom throttling implementations via options.SetErrorEventThrottler()
  • ContentBasedThrottler - Default implementation using message + stacktrace fingerprinting with a configurable dedupe window (default: 1000ms)

- Add ILogThrottler interface and ContentBasedThrottler implementation
- Throttle only LogError and LogException events (not breadcrumbs/structured logs)
- Use message + stacktrace fingerprinting to deduplicate repeated errors
- Add configuration via Editor window (Enable Event Throttling checkbox + Dedupe Window)
- Remove old TimeDebounceBase and related classes
- Update integrations to use new throttler

Closes #2004
@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 47f15ed

@TheCrossBoy
Copy link
Contributor

been following along on this for awhile and am very excited to see it so close!

minor thing: does ILogThrottler throttle log messages in addition to events / errors / messages? current name suggests it might but i believe it's just for the latter, which may be confusing

@bitsandfoxes
Copy link
Contributor Author

been following along on this for awhile and am very excited to see it so close!

minor thing: does ILogThrottler throttle log messages in addition to events / errors / messages? current name suggests it might but i believe it's just for the latter, which may be confusing

Excellent point. I renamed it to IErrorEventThrottler.

var throttler = new ContentBasedThrottler(TimeSpan.FromSeconds(10));
var message = "test message";

var result1 = throttler.ShouldCapture(message, "stacktrace", LogType.Log);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a need to also handle logs? Or make it configurable, for cases where a repeated log in game thread could be spamming a lot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve event debouncing and throtteling

4 participants